{extend name='base'/}

{block name='admin_box_l'}
<div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree"  lay-filter="test">
          <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">分类管理</a>
                <dl class="layui-nav-child">
                    <dd><a href="{{:url('Card/cate')}}">查看分类</a></dd>
                    <dd><a href="{{:url('Card/cateAdd')}}">添加分类</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">帖子管理</a>
                <dl class="layui-nav-child">
                    <dd><a class="" href="{{:url('Card/index')}}">帖子列表</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item layui-nav-itemed">
                <a class="" href="javascript:;">评论管理</a>
                <dl class="layui-nav-child">
                    <dd><a class="" href="{{:url('Card/evaluate')}}">评论列表</a></dd>
                </dl>
            </li>
        </ul>
    </div>
</div>
{/block}
{block name='admin_box_r'}
<div class="layui-body">
    <table class="layui-table" style="margin-top: 0px">
          <colgroup>
            <col width="20">
            <col width="150">
            <col width="100">
            <col width="100">
            <!-- <col width="250"> -->
            <col>
            <col>
            <col> 
            <col> 
            <col> 
            <col> 
            <col>
            <col width="150">
          </colgroup>
          <thead>
            <tr>
              <th>ID</th>
              <th>帖子名</th>
              <th>分类名</th>
              <th>发表用户</th>
              <!-- <th style="width: 280px">帖子内容</th> -->
              <th>金币数</th>
              <th>完结</th>
              <th>精华</th>
              <th>浏览数</th>
              <th>置顶</th>
              <th>显示</th>
              <th>发表时间</th>
              <th>操作</th>
            </tr> 
          </thead>
          <tbody>
            {foreach name='cardList' item='vo'}
            <tr style="height: 80px;">
              <th >{{$vo.cid}}</th>
              <th>{{$vo.name}}</th>
              <th>{{$vo.category_name}}</th>
              <th>{{$vo.user_id}}</th>
              <!-- <th>{{$vo.content}}</th> -->
              <th>{{$vo.gold}}</th>
              <th>{{$vo.is_end}}</th>
              <th>{{$vo.is_fine==0?'否':'是'}}</th>
              <th>{{$vo.browse}}</th>
              <th>
                <a href="{{:url('Card/is_first',['id'=>$vo.cid,'is_first'=>$vo.is_first])}}">{{$vo.is_first==0?'否':'是'}}</a>
              </th>
              <th>
                <a href="{{:url('Card/is_show',['id'=>$vo.cid,'is_show'=>$vo.is_show])}}">{{$vo.is_show==0?'否':'是'}}
            </th>
              <th>{{$vo.ccreate_time}}</th>
              <th width="150">
                <a href="{{:url('index/card/detail',['id'=>$vo.cid])}}" class="layui-btn layui-btn-xs layui-btn">查看</a>
                <!-- <a href="" class="layui-btn layui-btn-xs layui-btn-danger">移入回收站</a> -->
              </th>
            </tr>
            {/foreach}
          </tbody>
        </table>
</div>

{/block}

<script type="text/javascript">
        $(function(){
            $("#qd").click(function(){
                //将时间转化成时间戳
                layer.msg('更新中', {icon:16, shade: 0.1, time:0})
                // var time = Date.parse(new Date($(this).text()));
                $.ajax({
                    type: "get",
                    data: '',
                    dataType: 'json',
                    url: "{{:url('index/qd')}}",
                    success: function (data) {
                        if (data.status == 1) {
                            layer.msg('签到成功');
                        } else if(data.status == 0) {
                            layer.msg('亲,今天已经签到过啦!');
                        }else{
                            layer.msg('未知错误');

                        }
                    }
                })
                
            })
</script>